package service.impl;

import java.util.ArrayList;
import java.util.List;

import dao.CustomerDao;
import dao.CustomerDaoImpl;
import pojo.Customer;
import service.CustomerManager;

public class CustomerManagerImpl implements CustomerManager {
//private List<Customer> cl= new ArrayList<Customer>();
	public int addCustomer(Customer c) {
		//cl.add(c);
		CustomerDao customerDao = new CustomerDaoImpl();
		int m = customerDao.addCustomer(c);
		return m;
	}

	public List<Customer> findAll() {
		CustomerDao customerDao = new CustomerDaoImpl();
		List<Customer> cl = customerDao.findAll();
		return cl;
	}
	
	public int deleteCustomer(Integer id){
		CustomerDao customerDao = new CustomerDaoImpl();
		int m = customerDao.deleteCustomer(id);
		return m;
	}

	public int updateCustomer(Customer c) {
		CustomerDao customerDao = new CustomerDaoImpl();
		int m = customerDao.updateCustomer(c);
		return m;
	}

	public Customer SelectCustomer(Integer id) {
		CustomerDao customerDao = new CustomerDaoImpl();
		Customer c = customerDao.SelectCustomer(id);
		return c;
	}

}
